#ifndef NOISEGENERATOR_H
#define NOISEGENERATOR_H

#include <stdlib.h>

#define NOISE_SIZE 512

#ifndef uint
	#define uint unsigned int
#endif

namespace Y{

class NoiseGenerator{
	
	public:
		NoiseGenerator();
		
		float persistence;
		int octaves;
		static uint seed;
		
		float scale;
		
		static void generateNoise (uint s = 0);
			static float Noise[NOISE_SIZE][NOISE_SIZE][20];
			float noise(int,int,int);
			float noise(int,int);
		int xOffset;
		int yOffset;
		
		float noise1d (float x, int o);
			float cosineInterpolation(float a, float b, float x);
		float noise2d (float x, float y, int o);
		
		float perlinNoise1d (float x);
		float perlinNoise2d (float x, float y);
		
		float fractalSumNoise2d (int I,float x,float y);
		float fractalSumNoise2d_abs (int I,float x,float y);
};

}

#endif